package com.community.dao;

import com.community.pojo.Integral;
import org.apache.ibatis.annotations.Param;

public interface IntegralMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Integral record);

    int insertSelective(Integral record);

    Integral selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Integral record);

    int updateByPrimaryKey(Integral record);

    /**
     * 查现用户剩余积分
     * @param userName
     * @return
     */
    Integer selectSurplusByUserName(@Param(value = "userName") String userName);

    /**
     * 更新积分锁定状态
     * @param lockStatus
     * @param userName
     * @return
     */
    int updateLockStatusByUserName(@Param(value = "lockStatus") Integer lockStatus,@Param(value = "userName") String userName);

    /**
     * 查询积分锁定信息
     * @param userName
     * @return
     */
    Integer selectLockStatusByUserName(@Param(value = "userName") String userName);

    /**
     * 查询用户积分信息
     * @param userName
     * @return
     */
    Integral selectByUserName(String  userName);
}